home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
How Would You Survive?
/
How Would You Survive (1995)(Grolier)[Mac-PC].iso
/
mac
/
SHARED.DIR
/
01981_Script_aHozSlider
< prev
next >
Wrap
Text File
|
1995-09-13
|
1KB
|
59 lines
property pCast, pSprite, pLeftLimit,pRightLimit , pFunction , pDelta , pRange, pCursor
on birth me, theCast, theSprite, leftLim, rightLim, theFunction, theDelta, theCursor
set pFunction = theFunction
set pLeftLimit = leftLim
set pRightLimit = rightLim
set pCast = theCast
set pSprite = theSprite
puppetSprite pSprite, TRUE
set pDelta = theDelta
set pRange = (pRightLimit - pLeftLimit)
set pCursor = theCursor
return me
end
on SliderBar me
repeat while the mouseDown
do pCursor
set newH = the mouseH
if (newH < pLeftLimit) then
set the locH of sprite pSprite = pLeftLimit
else
if (newH > pRightLimit) then
set the locH of sprite pSprite = pRightLimit
else
set the locH of sprite pSprite = newH
end if
end if
do pFunction
upDateStage
end repeat
end
on getPercentH me
set pc = 100 - 100 * (pRightLimit - the locH of sprite pSprite)/(pRange)
return pc
end
on stepRight me
set newH = the locH of sprite pSprite + pDelta
if (newH < pRightLimit) then
set the locH of sprite pSprite = newH
upDateStage
end if
end
on stepLeft me
set newH = the locH of sprite pSprite - pDelta
if (newH > pLeftLimit) then
set the locH of sprite pSprite = newH
upDateStage
end if
end
on hidecontrol me
puppetSprite pSprite, false
end